<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>选择器示例</title>
    <script src="../../js/common.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function(){
            //基本选择器
            //$('div').css('color','red');
            $('#div1').css('background-color','yellow');
            $('.name').css('font-size','20px');
            $('div h4').css('background-color','orange');
            //层次选择器
            //1选择div2下的第一个子元素
            $('#div2>h4').css('color','red');
        });
    </script>
</head>
<body>
    <div id="div1">
        <h4>基本选择器</h4>
        name:<input type="text" class="name">
        age:<input type="number">
    </div>
    <div id="div2">
        <h4>层次选择器</h4>
        <ul>
            <h4>test</h4>
            <li class="lis"><span>aaaa</span></li>
            <li class="lis"><span>bbbb</span></li>
            <li class="lis"><span>bbbb</span></li>
            <span>dddd</span>
        </ul>
    </div>   
</body>
</html>